ip host

This command adds an entry to the IP hostname table for all Layer 3 interfaces. Use the no form of this command to delete an entry from the IP Hostname table for all Layer 3 interfaces.

The following are the relevant specifications:

RFC 1034
RFC 1035
RFC 2782 (SRV)
RFC 3403 (NAPTR)

Syntax

ip host <name> <ip address> <ttl> <tracking ID>
ip host <name> srv <priority> <weight> <port> <target> <ttl>
ip host <name> naptr <order> <preference> <flags> regexp <regexp> <ttl>
ip host <name> naptr <order> <preference> <flags> service <service> regexp <regexp> <ttl>
ip host <name> naptr <order> <preference> <flags> service <service> replacement <replacement> <ttl>

Command

Description

name

Specifies the name of the host. Up to 63 characters.

ip address

Specifies the host’s IPv4 (dotted decimal notation) or IPv6 address.

ttl

Defines Time-To-Live in seconds, range 0-2147483647.

priority

Defines the priority – a non-negative number with a range 0-65535.

weight

Defines the weight – a non-negative number with a range 0-65535.

port

Non-negative number, range 0-65535.

target

Domain name, up to 256 characters.

order

Non-negative number, range 0-65535.

preference

Non-negative number, range 0-65535.

flags

Currently four flags are defined: "S", "A", "U", and "P" (character-string).

service

Up to 64 characters and must start with an alphabetic (character-string).

tracking ID

If Tracking ID is configured, this DNS record is resolved only if the DNS server is unreachable. This is only relevant when a DNS server is configured. If not entered, the DNS record is always resolved.

regexp

Up to 256 characters (character-string).

replacement

Domain name, up to 256 characters.

Default

NA

Related Commands

ip dns server

Command Mode

Privileged User

Examples:

This example adds an entry with name ‘abcd’ and ip address ‘10.44.1.1’ to the IP Hostname table for all Layer 3 interfaces:

(config data)# ip host abcd 10.44.1.1 3600

This example (taken from RFC 2782) for adding SRV entry to the DNS server table for all Layer 3 interfaces:

(config data)# ip host _foobar._tcp srv 0 1 9 old-slow-box.example.com 3600

This example (taken from RFC 3403) for adding NAPTR entry to the DNS server table for all Layer 3 interfaces:

(config data)# ip host example.com naptr 100 50 A service z3950+N2L+N2C replacement cidserver.example.com 3600